﻿using System.Security.Principal;

namespace Bricks.Security
{
    
    /// <summary>
    /// 
    /// </summary>
    public interface IAuthorizationFacade
    {

        /// <summary>
        /// 
        /// </summary>
        /// <param name="principal"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        bool Authorize(IPrincipal principal, string key);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="principal"></param>
        /// <param name="key"></param>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        bool TryAuthorize(IPrincipal principal, string key, bool defaultValue);
    }

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TGuard"></typeparam>
    public interface IAuthorizationFacade<TGuard> : IAuthorizationFacade, IFacade<TGuard>
    {
    }
}
